﻿using FreeSql;
using KongMing.ORM.FreeSqlDemo.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KongMing.ORM.FreeSqlDemo
{
    public class FreeSqlDbContext : DbContext
    {
        public DbSet<Book> Books { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder builder)
        {
            //builder.UseFreeSql(GlobalVar.fsql);
            //这里直接指定一个静态的 IFreeSql 对象即可，切勿重新 Build()
        }

        //每个 DbContext 只触发一次
        protected override void OnModelCreating(ICodeFirst codefirst)
        {

        }
    }
}
